feat: add root-level tools map with customParameters to AI Config types#1295
feat: add root-level tools map with customParameters to AI Config types#1295jsonbailey merged 5 commits intomainfrom
Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk-common size report |
Adds LDTool interface and tools map (keyed by tool name) to completion and agent config types. The root-level tools map is distinct from model.parameters.tools[] which remains passable to LLM providers as-is. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f83c6ee to
667aebf
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d0eb383. Configure here.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…has no tools Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 I have created a release *beep* *boop* --- <details><summary>jest: 1.0.13</summary> ## [1.0.13](jest-v1.0.12...jest-v1.0.13) (2026-04-27) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/react-native-client-sdk bumped from ~10.17.1 to ~10.17.2 </details> <details><summary>react-native-client-sdk: 10.17.2</summary> ## [10.17.2](react-native-client-sdk-v10.17.1...react-native-client-sdk-v10.17.2) (2026-04-27) ### Bug Fixes * **react-native:** `package.json` should declare esm format ([#1322](#1322)) ([149ae73](149ae73)) </details> <details><summary>server-sdk-ai: 0.18.0</summary> ## [0.18.0](server-sdk-ai-v0.17.1...server-sdk-ai-v0.18.0) (2026-04-27) ### Features * Add root-level tools map with customParameters to AI Config types ([#1295](#1295)) ([487182b](487182b)) </details> <details><summary>server-sdk-ai-langchain: 0.6.0</summary> ## [0.6.0](server-sdk-ai-langchain-v0.5.6...server-sdk-ai-langchain-v0.6.0) (2026-04-27) ### Features * Bump to LangChain 1.0 and drop community package requirement ([#1311](#1311)) ([f5a1c29](f5a1c29)) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/server-sdk-ai bumped from ^0.17.1 to ^0.18.0 * peerDependencies * @launchdarkly/server-sdk-ai bumped from ^0.17.0 to ^0.18.0 </details> <details><summary>server-sdk-ai-openai: 0.5.7</summary> ## [0.5.7](server-sdk-ai-openai-v0.5.6...server-sdk-ai-openai-v0.5.7) (2026-04-27) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/server-sdk-ai bumped from ^0.17.1 to ^0.18.0 * peerDependencies * @launchdarkly/server-sdk-ai bumped from ^0.17.0 to ^0.18.0 </details> <details><summary>server-sdk-ai-vercel: 0.5.7</summary> ## [0.5.7](server-sdk-ai-vercel-v0.5.6...server-sdk-ai-vercel-v0.5.7) (2026-04-27) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/server-sdk-ai bumped from ^0.17.1 to ^0.18.0 * peerDependencies * @launchdarkly/server-sdk-ai bumped from ^0.17.0 to ^0.18.0 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Primarily a release/version-bump PR, but it updates AI provider peer/dependency ranges (notably moving `server-sdk-ai-langchain` to LangChain v1) which may introduce runtime or type-compatibility issues for consumers. > > **Overview** > Updates release metadata and publishes new versions of several packages (`server-sdk-ai` `0.18.0`, `server-sdk-ai-langchain` `0.6.0`, `server-sdk-ai-openai`/`server-sdk-ai-vercel` `0.5.7`, `react-native-client-sdk` `10.17.2`, and `@launchdarkly/jest` `1.0.13`). > > This release bumps the AI LangChain provider to *LangChain 1.x* and aligns AI provider packages’ `@launchdarkly/server-sdk-ai` peer/dev dependency requirements to `^0.18.0`; examples are updated to consume the new versions. It also includes a React Native SDK packaging fix (declaring ESM) and propagates that version bump into the React Native examples and Jest tooling dependency. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 530460b. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Summary
LDToolinterface withname,type?,parameters?, andcustomParameters?fieldstools?: { [toolName: string]: LDTool }toLDAICompletionConfig,LDAICompletionConfigDefault,LDAIAgentConfig, andLDAIAgentConfigDefaultLDAIConfigFlagValueandLDAIConfigUtilsto parse and propagate the root-leveltoolsmapBackground
The LaunchDarkly backend now includes a root-level
toolsmap (sibling tomodel) in AI Config flag variations. This is separate frommodel.parameters.tools[]which is the raw array passable to LLM providers as-is. LLM providers reject unknown properties, socustomParameterscannot live insidemodel.parameters.tools[]— hence the split.Wire format:
{ "tools": { "web-search-tool": { "name": "web-search-tool", "type": "function", "parameters": { ... }, "customParameters": { "some-custom-parameter": "some-custom-value" } } } }Note
Supersedes PR #1175 (
devin/1773277027-add-tool-instructions-examples) which had the wrong structure (array instead of map, wrong fieldskey/version/instructions/examples, and targetedmaininstead offeat/ai-sdk-next-release).Test plan
yarn workspace @launchdarkly/server-sdk-ai test— all existing tests pass, 4 new tests for tools map coverageyarn workspace @launchdarkly/server-sdk-ai build— no TypeScript errorsyarn workspace @launchdarkly/server-sdk-ai lint— no lint errors🤖 Generated with Claude Code
Note
Medium Risk
Moderate risk because it expands the public AI Config type surface and changes how flag variations are parsed/serialized, which could affect downstream consumers expecting previous shapes.
Overview
Adds a new root-level
toolsmap to AI Config defaults and evaluated configs (completion and agent) via a newLDTooltype that supportscustomParameters.Updates
LDAIConfigUtilsto includetoolswhen building default flag values and to propagatetoolsfrom LaunchDarkly flag variations into the returned config objects, with new tests validating presence/absence behavior for both completion and agent configs.Reviewed by Cursor Bugbot for commit de94725. Bugbot is set up for automated code reviews on this repo. Configure here.